package com.danny.demo.single.signle_model;

/**
 * @ClassName: SingleObjectSynchronized
 * @Description: 懒汉式，线程安全
 * @Author: zhangdong
 * @Date: Created in 10:16 2019/6/26
 * @Version:
 */
public class SingleObjectSynchronized {
    private static SingleObjectSynchronized instance;
    private SingleObjectSynchronized(){}

    public static synchronized SingleObjectSynchronized getInstance(){
        if (instance == null){
            instance = new SingleObjectSynchronized();
        }
        return instance;
    }
}
